package com.sh.ndt.user.mapper;

import com.sh.ndt.common.mapper.BaseRowMapper;
import com.sh.ndt.user.entity.UserRole;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Mapper class used to map User Role data returned by sp_Login
 * 
 * @author Prashanth
 */
public class UserRoleMapper extends BaseRowMapper {
    
    @Override
    public Object mapRow(ResultSet rs, int rowNum) throws SQLException
    {
        UserRole userRole = null; 
        
        userRole = new UserRole();
        userRole.setRoleId(rs.getInt("idt_role"));
        userRole.setUserId(rs.getInt("idt_user"));
        userRole.setUserRoleId(rs.getInt("idt_user_role"));
        userRole.setRoleName(rs.getString("role_name"));
        
        return userRole;              
    }
}
